cmake_minimum_required(VERSION 3.16)

project(CompoundMechine_15Axis VERSION 0.1 LANGUAGES CXX)

set(CMAKE_AUTOMOC ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_AUTORCC ON)

find_package(Qt6 6.2 COMPONENTS Quick SerialBus REQUIRED)
find_package(Qt6 REQUIRED COMPONENTS Core)
find_package(Qt6 REQUIRED COMPONENTS SerialBus)
find_package(Qt6 REQUIRED COMPONENTS Sql)
find_package(Qt6 REQUIRED COMPONENTS Core)
find_package(Qt6 REQUIRED COMPONENTS Core)
find_package(Qt6 REQUIRED COMPONENTS Core)
find_package(Qt6 REQUIRED COMPONENTS Core)
find_package(Qt6 REQUIRED COMPONENTS Core)
find_package(Qt6 REQUIRED COMPONENTS Core)
find_package(Qt6 REQUIRED COMPONENTS Core)
find_package(Qt6 REQUIRED COMPONENTS Core)

qt_add_executable(CompoundMechine_15Axis
    main.cpp
)

qt_add_qml_module(CompoundMechine_15Axis
    URI CompoundMechine_15Axis
    VERSION 1.0
    QML_FILES main.qml
    QML_FILES AutoProcessWindow.qml
    QML_FILES A_Button.qml
    QML_FILES A_TextInput.qml
    QML_FILES Paramaters_Of_15Axis.qml
    QML_FILES NumberInput.qml
    QML_FILES NumberKeyboard.qml
    QML_FILES A_CheckBox.qml
    QML_FILES ManualProcessWindow.qml
    QML_FILES IO_MonitorWindow.qml
    QML_FILES MaterialListWindow.qml
    QML_FILES MaterialParameterWindow.qml
    QML_FILES MaterialList_PortParameter_Window.qml
    QML_FILES SystemParameterWindow.qml
    QML_FILES System_PressedAxis_Parameter.qml
    QML_FILES System_KnifeAxis_Parameter.qml
    QML_FILES System_ExtraAxis_Parameter.qml
    SOURCES modbustcp_class.h modbustcp_class.cpp
    SOURCES appengine.h appengine.cpp
    QML_FILES System_SetZero_Window.qml
    SOURCES historymodel.h historymodel.cpp
    SOURCES Warning_Mid.h
    QML_FILES WarningList_Area.qml
    QML_FILES ProcessListView.qml
    SOURCES parameteritem.h parameteritem.cpp
    SOURCES parametermodel.h parametermodel.cpp
    SOURCES parametersqldb.h parametersqldb.cpp
    SOURCES processdatamanager.h processdatamanager.cpp
    QML_FILES MiniProcessList.qml
    SOURCES scannercontrol.h scannercontrol.cpp
    SOURCES printercontrol.h printercontrol.cpp
    SOURCES initdata.h initdata.cpp
    QML_FILES System_Connect_Parameters_Window.qml
)


# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
# If you are developing for iOS or macOS you should consider setting an
# explicit, fixed bundle identifier manually though.
set_target_properties(CompoundMechine_15Axis PROPERTIES
#    MACOSX_BUNDLE_GUI_IDENTIFIER com.example.CompoundMechine_15Axis
    MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
    MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
    MACOSX_BUNDLE TRUE
    WIN32_EXECUTABLE TRUE
)

target_link_libraries(CompoundMechine_15Axis
    PRIVATE Qt6::Quick
    PRIVATE Qt6::SerialBus
    PRIVATE Qt6::Sql
)
target_link_libraries(CompoundMechine_15Axis PRIVATE Qt6::Core)
target_link_libraries(CompoundMechine_15Axis PRIVATE Qt6::Core)
target_link_libraries(CompoundMechine_15Axis PRIVATE Qt6::Core)
target_link_libraries(CompoundMechine_15Axis PRIVATE Qt6::Core)
target_link_libraries(CompoundMechine_15Axis PRIVATE Qt6::Core)
target_link_libraries(CompoundMechine_15Axis PRIVATE Qt6::Core)
target_link_libraries(CompoundMechine_15Axis PRIVATE Qt6::Core)
target_link_libraries(CompoundMechine_15Axis PRIVATE Qt6::Core)


include(GNUInstallDirs)
install(TARGETS CompoundMechine_15Axis
    BUNDLE DESTINATION .
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
